using BlogExample.Core.Domain;
using BlogExample.Core.Services;
using NUnit.Framework;
using FubuMVC.Tests;

namespace BlogExample.Tests.Services
{
	[TestFixture]
	public class IdentifierDisplayStrategyTester
	{
		private IdentifierDisplayStrategy _strategy;

		[SetUp]
		public void Setup()
		{
			_strategy = new IdentifierDisplayStrategy();
		}

		[Test]
		public void should_match_on_identifier_object()
		{
			_strategy.Matches(new Course()).ShouldBeTrue();
		}

		[Test]
		public void should_not_match_on_non_identifier_object()
		{
			_strategy.Matches(new DomainEntity()).ShouldBeFalse();
		}

		[Test]
		public void should_return_description_with_identifier_for_the_course()
		{
			var course = new Course() {Identifier = "1005", Name = "Skippy"};
			_strategy.GetEntityDescription(course).ShouldEqual("1005 Skippy");
		}
	}
}